package cn.pojo;

import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class Customer {
    private Integer cusId;

    @NotNull
    @Pattern(regexp = "^([a-zA-Z]*[0-9_-]*$)", message = "只能包含字母、数字、下划线，且不能以数字或下划线开头")
    @Size(min = 8, max = 128)
    private String cusName;

    @NotNull
    @Min(18)
    @Max(40)
    private Integer cusAge;

    @NotNull
    private Integer cusSex;

    @NotNull
    @Size(min = 6, max = 11)
    @Pattern(regexp = "^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$", message = "请输入正确的手机号")
    private String cusPhone;

    @NotNull
    @Size(min = 10, max = 20)
    @Pattern(regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$", message = "请输入正确的电子邮箱")
    private String cusEmail;
}
